package com.nit.lab.model;

import javax.persistence.*;

/**
 * Created by shen on 2017/11/21.
 */
@Entity
@Table(name = "sys_user", schema = "coolprint", catalog = "")
public class SysUserEntity {
    private int userId;
    private String userName;
    private String userRealName;
    private String userPhone;
    private String userEmail;
    private String userCode;
    private String userSchool;
    private int actorId;
    private Integer userIntegral;
    private Double usedMoney;
    private Double userGold;
    private Integer isDelete;
    private String userPicUrl;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "userId")
    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    @Basic
    @Column(name = "userName")
    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    @Basic
    @Column(name = "userRealName")
    public String getUserRealName() {
        return userRealName;
    }

    public void setUserRealName(String userRealName) {
        this.userRealName = userRealName;
    }

    @Basic
    @Column(name = "userPhone")
    public String getUserPhone() {
        return userPhone;
    }

    public void setUserPhone(String userPhone) {
        this.userPhone = userPhone;
    }

    @Basic
    @Column(name = "userEmail")
    public String getUserEmail() {
        return userEmail;
    }

    public void setUserEmail(String userEmail) {
        this.userEmail = userEmail;
    }

    @Basic
    @Column(name = "userCode")
    public String getUserCode() {
        return userCode;
    }

    public void setUserCode(String userCode) {
        this.userCode = userCode;
    }

    @Basic
    @Column(name = "userSchool")
    public String getUserSchool() {
        return userSchool;
    }

    public void setUserSchool(String userSchool) {
        this.userSchool = userSchool;
    }

    @Basic
    @Column(name = "actorId")
    public int getActorId() {
        return actorId;
    }

    public void setActorId(int actorId) {
        this.actorId = actorId;
    }

    @Basic
    @Column(name = "userIntegral")
    public Integer getUserIntegral() {
        return userIntegral;
    }

    public void setUserIntegral(Integer userIntegral) {
        this.userIntegral = userIntegral;
    }

    @Basic
    @Column(name = "usedMoney")
    public Double getUsedMoney() {
        return usedMoney;
    }

    public void setUsedMoney(Double usedMoney) {
        this.usedMoney = usedMoney;
    }

    @Basic
    @Column(name = "userGold")
    public Double getUserGold() {
        return userGold;
    }

    public void setUserGold(Double userGold) {
        this.userGold = userGold;
    }

    @Basic
    @Column(name = "isDelete")
    public Integer getIsDelete() {
        return isDelete;
    }

    public void setIsDelete(Integer isDelete) {
        this.isDelete = isDelete;
    }

    @Basic
    @Column(name = "userPicUrl")
    public String getUserPicUrl() {
        return userPicUrl;
    }

    public void setUserPicUrl(String userPicUrl) {
        this.userPicUrl = userPicUrl;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        SysUserEntity that = (SysUserEntity) o;

        if (userId != that.userId) return false;
        if (actorId != that.actorId) return false;
        if (userName != null ? !userName.equals(that.userName) : that.userName != null) return false;
        if (userRealName != null ? !userRealName.equals(that.userRealName) : that.userRealName != null) return false;
        if (userPhone != null ? !userPhone.equals(that.userPhone) : that.userPhone != null) return false;
        if (userEmail != null ? !userEmail.equals(that.userEmail) : that.userEmail != null) return false;
        if (userCode != null ? !userCode.equals(that.userCode) : that.userCode != null) return false;
        if (userSchool != null ? !userSchool.equals(that.userSchool) : that.userSchool != null) return false;
        if (userIntegral != null ? !userIntegral.equals(that.userIntegral) : that.userIntegral != null) return false;
        if (usedMoney != null ? !usedMoney.equals(that.usedMoney) : that.usedMoney != null) return false;
        if (userGold != null ? !userGold.equals(that.userGold) : that.userGold != null) return false;
        if (isDelete != null ? !isDelete.equals(that.isDelete) : that.isDelete != null) return false;
        if (userPicUrl != null ? !userPicUrl.equals(that.userPicUrl) : that.userPicUrl != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = userId;
        result = 31 * result + (userName != null ? userName.hashCode() : 0);
        result = 31 * result + (userRealName != null ? userRealName.hashCode() : 0);
        result = 31 * result + (userPhone != null ? userPhone.hashCode() : 0);
        result = 31 * result + (userEmail != null ? userEmail.hashCode() : 0);
        result = 31 * result + (userCode != null ? userCode.hashCode() : 0);
        result = 31 * result + (userSchool != null ? userSchool.hashCode() : 0);
        result = 31 * result + actorId;
        result = 31 * result + (userIntegral != null ? userIntegral.hashCode() : 0);
        result = 31 * result + (usedMoney != null ? usedMoney.hashCode() : 0);
        result = 31 * result + (userGold != null ? userGold.hashCode() : 0);
        result = 31 * result + (isDelete != null ? isDelete.hashCode() : 0);
        result = 31 * result + (userPicUrl != null ? userPicUrl.hashCode() : 0);
        return result;
    }
}
